package com.ruoyi.franchise.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.franchise.mapper.FranchiseCompanyMapper;
import com.ruoyi.franchise.domain.FranchiseCompany;
import com.ruoyi.franchise.service.IFranchiseCompanyService;

/**
 * 加盟公司Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-12
 */
@Service
public class FranchiseCompanyServiceImpl implements IFranchiseCompanyService 
{
    @Autowired
    private FranchiseCompanyMapper franchiseCompanyMapper;

    /**
     * 查询加盟公司
     * 
     * @param id 加盟公司主键
     * @return 加盟公司
     */
    @Override
    public FranchiseCompany selectFranchiseCompanyById(Integer id)
    {
        return franchiseCompanyMapper.selectFranchiseCompanyById(id);
    }

    /**
     * 查询加盟公司列表
     * 
     * @param franchiseCompany 加盟公司
     * @return 加盟公司
     */
    @Override
    public List<FranchiseCompany> selectFranchiseCompanyList(FranchiseCompany franchiseCompany)
    {
        return franchiseCompanyMapper.selectFranchiseCompanyList(franchiseCompany);
    }

    /**
     * 新增加盟公司
     * 
     * @param franchiseCompany 加盟公司
     * @return 结果
     */
    @Override
    public int insertFranchiseCompany(FranchiseCompany franchiseCompany)
    {
        franchiseCompany.setCreateTime(DateUtils.getNowDate());
        return franchiseCompanyMapper.insertFranchiseCompany(franchiseCompany);
    }

    /**
     * 修改加盟公司
     * 
     * @param franchiseCompany 加盟公司
     * @return 结果
     */
    @Override
    public int updateFranchiseCompany(FranchiseCompany franchiseCompany)
    {
        franchiseCompany.setUpdateTime(DateUtils.getNowDate());
        return franchiseCompanyMapper.updateFranchiseCompany(franchiseCompany);
    }

    /**
     * 批量删除加盟公司
     * 
     * @param ids 需要删除的加盟公司主键
     * @return 结果
     */
    @Override
    public int deleteFranchiseCompanyByIds(Integer[] ids)
    {
        return franchiseCompanyMapper.deleteFranchiseCompanyByIds(ids);
    }

    /**
     * 删除加盟公司信息
     * 
     * @param id 加盟公司主键
     * @return 结果
     */
    @Override
    public int deleteFranchiseCompanyById(Integer id)
    {
        return franchiseCompanyMapper.deleteFranchiseCompanyById(id);
    }
}
